//
// Created by xxkj on 2019-11-5.
//

#ifndef OOR_COOR_H
#define OOR_COOR_H

#include "ncnn_tools.h"
#include "darknet2ncnn.h"
#include "net.h"
//#include <opencv/cv.h>
//#include <opencv2/opencv.hpp>
#include <string>
#include <vector>
#include <time.h>
#include <algorithm>
#include <map>
#include <iostream>
#include <math.h>

using namespace std;
//using namespace cv;
struct Object
{
    cv::Rect_<float> rect;
    int label;
    float prob;
};

class Coor {

public:
    Coor(const string &model_path);
    Coor(const std::vector<std::string> param_files, const std::vector<std::string> bin_files);
    ~Coor();

    void SetInputSize(int resSize);
    int GetInputImgSize();
    void SetNumThreads(int numThreads);
    void SetTimeCount(int timeCount);
    //int cutFace(ncnn::Mat ncnn_img_src, int type, int w, int h, CutFace_params &cp, Bbox finalBox,cv::Mat &cutface);
    int detect(ncnn::Mat& img_, std::vector<Object>& finalBbox,int oriw,int orih);
    ncnn::Net net;

private:

    int resize_size = 416;
    int count = 0;

    ncnn::Mat img;
    //const float nms_threshold[3] = {0.5f, 0.7f, 0.7f};

    //const float mean_vals[3] = {0, 0, 0};
    //const float norm_vals[3] = {1.0/256, 1.0/256, 1.0/256};

    int img_w, img_h;

private://部分可调参数

    int num_threads = 4;

};

#endif //OOR_COOR_H
